package Method_References;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public class number2 {
	public static void main(String[] args) {
		ArrayList<String> list = new ArrayList<String>();
		Collections.addAll(list, "张无忌-男-15", "周芷若-女-14", "赵敏-女-13", "张强-男-20", "张三丰-男-100", "张翠山-男-40", "张良-男-35",
				"王二麻子-男-35", "谢广坤-女-41", "林婷-女-22", "林立-女-23");
		List<String> collect = list.stream().filter(s -> "男".equals(s.split("-")[1]))
				.filter(s -> s.split("-")[0].length() == 3).limit(3).collect(Collectors.toList());

		List<String> collect2 = list.stream().filter(s -> "女".equals(s.split("-")[1]))
				.filter(s -> s.split("-")[0].startsWith("林")).skip(1).collect(Collectors.toList());
		collect.addAll(collect2);
		System.out.println(collect);

	}
}
